.Net Kernel and ISKFunction Streaming Option #1 (Phase 1)#3496
Merged
rogerbarreto merged 61 commits intomicrosoft:mainfrom Nov 24, 2023
Merged
.Net Kernel and ISKFunction Streaming Option #1 (Phase 1)#3496rogerbarreto merged 61 commits intomicrosoft:mainfrom
rogerbarreto merged 61 commits intomicrosoft:mainfrom
Conversation
…nto adrs/kernel-streaming
…nto adrs/kernel-streaming
…/RogerBarreto/semantic-kernel into feaures/kernel-streaming-option1
Member
markwallace-microsoft
left a comment
There was a problem hiding this comment.
What is the plan to add unit and integration tests for this?
dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/IChatCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/IChatCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatCompletionExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/AI/TextCompletion/ITextCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/AI/TextCompletion/ITextCompletion.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Core/Functions/SKFunctionFromPrompt.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Core/Functions/SKFunctionFromPrompt.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Core/Functions/StreamingMethodContent.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Core/Functions/SKFunctionFromMethod.cs
Outdated
Show resolved
Hide resolved
SergeyMenshykh
approved these changes
Nov 24, 2023
markwallace-microsoft
approved these changes
Nov 24, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context and Problem Statement
Resolves #1649
Resolves #1298
It is quite common in co-pilot implementations to have a streamlined output of messages from the LLM (large language models) and currently that is not possible while using ISKFunctions.InvokeAsync or Kernel.RunAsync methods, which enforces users to work around the Kernel and Functions to use
ITextCompletionandIChatCompletionservices directly as the only interfaces that currently support streaming.Currently streaming is a capability that not all providers do support and this as part of our design we try to ensure the services will have the proper abstractions to support streaming not only of text but be open to other types of data like images, audio, video, etc.
Needs to be clear for the sk developer when he is attempting to get streaming data.
Decision Drivers
The sk developer should be able to get streaming data from the Kernel and Functions using Kernel.RunAsync or ISKFunctions.InvokeAsync methods
The sk developer should be able to get the data in a generic way, so the Kernel and Functions can be able to stream data of any type, not limited to text.
The sk developer when using streaming from a model that does not support streaming should still be able to use it with only one streaming update representing the whole data.
User Experience Goal
Out of Scope
Contribution Checklist